home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 44 / PC Actual CD 44.iso / Linux / Cygwin / full.exe / Disk1 / data1.cab / Tools / share / tix4.1 / FileDlg.tcl < prev    next >
Encoding:
Text File  |  1998-12-04  |  2.0 KB  |  71 lines

  1. # FileDlg.tcl --
  2. #
  3. #    Implements the File Selection Dialog widget.
  4. #
  5. # Copyright (c) 1996, Expert Interface Technologies
  6. #
  7. # See the file "license.terms" for information on usage and redistribution
  8. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  9. #
  10.  
  11. tixWidgetClass tixFileSelectDialog {
  12.     -classname TixFileSelectDialog
  13.     -superclass tixStdDialogShell
  14.     -method {
  15.     }
  16.     -flag {
  17.     -command
  18.     }
  19.     -configspec {
  20.     {-command command Command ""}
  21.  
  22.     {-title title Title "Select A File"}
  23.     }
  24. }
  25.  
  26. proc tixFileSelectDialog:ConstructTopFrame {w frame} {
  27.     upvar #0 $w data
  28.  
  29.     tixChainMethod $w ConstructTopFrame $frame
  30.  
  31.     set data(w:fsbox) [tixFileSelectBox $frame.fsbox \
  32.     -command "tixFileSelectDialog:Invoke $w"]
  33.     pack $data(w:fsbox) -expand yes -fill both
  34. }
  35.  
  36. proc tixFileSelectDialog:SetBindings {w} {
  37.     upvar #0 $w data
  38.  
  39.     tixChainMethod $w SetBindings
  40.  
  41.     $data(w:btns) subwidget ok     config -command "$data(w:fsbox) invoke" \
  42.     -underline 0
  43.     $data(w:btns) subwidget apply  config -command "$data(w:fsbox) filter" \
  44.     -text Filter -underline 0
  45.     $data(w:btns) subwidget cancel config -command "wm withdraw $w" \
  46.     -underline 0
  47.     $data(w:btns) subwidget help config -underline 0
  48.  
  49.  
  50.     bind $w <Alt-Key-l> "focus [$data(w:fsbox) subwidget filelist]"
  51.     bind $w <Alt-Key-d> "focus [$data(w:fsbox) subwidget dirlist]"
  52.     bind $w <Alt-Key-s> "focus [$data(w:fsbox) subwidget selection]"
  53.     bind $w <Alt-Key-t> "focus [$data(w:fsbox) subwidget filter]"
  54.     bind $w <Alt-Key-o> "tkButtonInvoke [$data(w:btns) subwidget ok]"
  55.     bind $w <Alt-Key-f> "tkButtonInvoke [$data(w:btns) subwidget apply]"
  56.     bind $w <Alt-Key-c> "tkButtonInvoke [$data(w:btns) subwidget cancel]"
  57.     bind $w <Alt-Key-h> "tkButtonInvoke [$data(w:btns) subwidget help]"
  58. }
  59.  
  60. proc tixFileSelectDialog:Invoke {w filename} {
  61.     upvar #0 $w data
  62.  
  63.     wm withdraw $w
  64.  
  65.     if {$data(-command) != ""} {
  66.     set bind(specs) "%V"
  67.     set bind(%V) $filename
  68.     tixEvalCmdBinding $w $data(-command) bind $filename
  69.     }
  70. }
  71.